module Bit16ToBit8 (
	input [15:0] cnt,
	input Mode, //0A 1B
	output [7:0] LSBbinaryout,
	output [7:0] MSBbinaryout
);

	wire [7:0] second, msecond_10, minute, min_second;
	wire [7:0] LSB_A, MSB_A, LSB_B, MSB_B;

	assign second = cnt / 100;
	assign msecond_10 = cnt % 100;
	assign MSB_A = second;
	assign LSB_A = msecond_10;

	assign minute = (cnt == 121) ? 8'd99 : (cnt > 0) ? ((cnt-1) / 60 + 8'd98) : 8'd97;
	assign min_second = (cnt == 121) ? 8'd99 : (cnt > 0) ? ((cnt-1) % 60 + 8'd40) : 8'd99;
	assign MSB_B = minute;
	assign LSB_B = min_second;

	Mux2To1_8 mux_msb (
		.sel(Mode),
		.a(MSB_A),
		.b(MSB_B),
		.out(MSBbinaryout)
	);

	Mux2To1_8 mux_lsb (
		.sel(Mode),
		.a(LSB_A),
		.b(LSB_B),
		.out(LSBbinaryout)
	);

endmodule
